from selenium.webdriver.common.by import By
from base.base_page import BasePage

class LoginPage(BasePage):
    def __init__(self):
        super().__init__()
        # self.user = (By.ID,"username")
        # self.pwd = (By.XPATH,"//*[@type='password']")
        # self.code = (By.CSS_SELECTOR,"[name='verify_code']")
        # self.login_button = (By.CSS_SELECTOR,"[name='sbtbutton']")
        self.user = (By.XPATH,
                    "//*[@id='app']/div[3]/div/div[2]/div/div/div[1]/div[1]/input")
        self.pwd = (By.XPATH,
                    "//*[@id='app']/div[3]/div/div[2]/div/div/div[1]/div[2]/input")
        self.login_button = (By.XPATH,
                "//*[@id='app']/div[3]/div/div[2]/div/div/div[1]/button")
        self.login_button1 = (By.XPATH,
                             "//*[@id='app']/header/div/div[2]/div[1]")

    def home_to_login(self):
        self.find_el(self.login_button1).click()
    def login(self, user, pwd):
        self.input_text(self.find_el(self.user), user)
        self.input_text(self.find_el(self.pwd), pwd)
        self.find_el(self.login_button).click()

if __name__ == '__mian__':
    print(LoginPage().user)
    print(*LoginPage().user)
